Fix more failures of visual-order cursor movement under word-wrap (bug#16961).
authorEli Zaretskii <eliz@gnu.org>
Sat, 8 Mar 2014 10:54:43 +0000 (12:54 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 8 Mar 2014 10:54:43 +0000 (12:54 +0200)
commitd03f37424a06e6462de037eaf22a4a40eb302e09
treebc4495952b44d41d1b81781e1da3c15e0b923c91
parentd0cb237aff6cb6ceb292a6d37b9767224f483909
Fix more failures of visual-order cursor movement under word-wrap (bug#16961).

 src/xdisp.c (move_it_in_display_line_to): If word-wrap is ON, and
 there's a valid wrap point in the display line, the last glyph
 cannot "just barely fit" on this row, because display_line doesn't
 let it.  Instead, proceed as if the last glyph didn't fit, so that
 we eventually back up the iterator to the wrap point.  This avoids
 delusional behavior of move_it_to, whereby it proceeds to the next
 display line, but sets current_x to zero for all the glyphs that
 without word-wrap would fit on the previous display line.  One
 result was that visual-order cursor movement behaved erratically
 under word-wrap.
 (Fmove_point_visually): Add code to find the x coordinate of the
 last character before wrap point, under word-wrap on a TTY.
src/ChangeLog
src/xdisp.c